#include<bits/stdc++.h>
using namespace std;

int solution(int n, int v, vector<int> x, vector<int> y)
{
	int ans = 0;
	for(int i = 0;i < n;i++)
		if(y[i] < v)
			ans++;
	return ans;
}

int main()
{
	int n, v, a;
	vector<int> x, y;
	cin>>n>>v;
	for(int i = 1;i <= n;i++)
	{
		cin>>a;
		x.push_back(a);
		cin>>a;
		y.push_back(a);
	}
	cout<<solution(n, v, x, y); 
	return 0;
}

